package com.reebake.ideal.desensitize.config;

import com.reebake.ideal.desensitize.properties.DesensitizeProperties;
import com.reebake.ideal.desensitize.core.DefaultDesensitizeHandler;
import com.reebake.ideal.desensitize.core.DesensitizeHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties({DesensitizeProperties.class})
public class DesensitizeAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    DesensitizeHandler desensitizeHandler() {
        return new DefaultDesensitizeHandler();
    }
}
